# ------------------------------------------------------------------------------
# CMake configuration for JSIDPlay2 (native C support to create a WAV recording)
#
# This configuration builds a small native executable used by the JSIDPlay2
# project and the TeaVM C backend. It provides minimal C-side functionality
# required for generating WAV recordings. The sources are compiled with C11
# support and the resulting binary is placed into "build/dist".
#
# Author: Ken Händel
# ------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.9)
project(jsidplay2 C)

set(CMAKE_C_STANDARD 11)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/build/dist)

if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE Release)
endif()

set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")

add_executable(jsidplay2 ./all.c)

target_link_libraries(jsidplay2 m)
